dataset="../../dataset"
log_train_csv := $(dataset)/log_train.csv
log_test_csv := $(dataset)/test/log_test.csv
tmp := tmp/

# log 中用户 event 时间统计
user_event_times: $(tmp)/train.user_event_times $(tmp)/test.user_event_times
$(tmp)/train.user_event_times: ./user_event_times.py
	python ./user_event_times.py $(log_train_csv) $(tmp)/train.user_event_times.csv
$(tmp)/test.user_event_times: ./user_event_times.py
	python ./user_event_times.py $(log_test_csv) $(tmp)/test.user_event_times.csv

# log 中 用户 event的数目统计
user_event_count: $(tmp)/train.user_event_count $(tmp)/test.user_event_count
$(tmp)/train.user_event_count: ./user_event_count.py $(tmp)/train.user_event_times.csv
	python ./user_event_count.py $(tmp)/train.user_event_times.csv $(tmp)/train.user_event_count.csv
$(tmp)/test.user_event_count: ./user_event_count.py $(tmp)/test.user_event_times.csv
	python ./user_event_count.py $(tmp)/test.user_event_times.csv $(tmp)/test.user_event_count.csv

# log 中 用户 event的比例
user_event_ratio: $(tmp)/train.user_event_ratio.csv $(tmp)/test.user_event_ratio.csv
$(tmp)/train.user_event_ratio.csv: ./user_event_ratio.py $(tmp)/train.user_event_count.csv
	python ./user_event_ratio.py $(tmp)/train.user_event_count.csv $(tmp)/train.user_event_ratio.csv
$(tmp)/test.user_event_ratio.csv: ./user_event_ratio.py $(tmp)/test.user_event_count.csv
	python ./user_event_ratio.py $(tmp)/test.user_event_count.csv $(tmp)/test.user_event_ratio.csv

